# -*-coding: Utf-8 -*-
# @File : teacher .py
# author: Chimengmeng
# blog_url : https://www.cnblogs.com/dream-ze/
# Time：2024/5/7
from lib import Tools, decorator
from interface import TeacherInterface
from db import Course, Teacher


class TeacherView(object):
    def __init__(self):
        self.teacher_menu = '''
        =====================这里是讲师功能菜单=====================
                                1.登录
                                2.查看指定课程下学生和分数
                                3.选择课程
                                4.查看教授课程信息
                                5.修改学生的分数
                                q:退出系统               
        ==========================菜单结束==========================
        '''
        self.teacher_dict = {
            1: 'login',
            2: 'check_course_student',
            3: 'select_teacher_course',
            4: 'check_teacher_course',
            5: 'update_student_score'
        }
        self.tools = Tools()
        self.login_dict = {'username': "", "role": ""}
        self.interface = TeacherInterface()

    def login(self):
        username, password = self.tools.get_username_password()
        flag, msg = self.interface.login_interface(username=username, password=password)
        self.login_dict.update({'username': username, 'role': 'Teacher'})
        return flag, msg

    @decorator(tag='login')
    def check_course_student(self):
        '''
        查看指定课程下学生和分数
        :return:
        '''
        ...

    @decorator(tag='login')
    def select_teacher_course(self):
        '''
        选择教授的课程
        :return:
        '''
        # 【一】展示当前所有的课程名字
        ...

    @decorator(tag='login')
    def check_teacher_course(self):
        '''
        查看教授课程信息
        :return:
        '''
        ...

    @decorator(tag='login')
    def update_student_score(self):
        '''
        修改学生的分数
        :return:
        '''
        ...
